package v1

import (
	"devops-super/api"
	"devops-super/internal/model/mymodel"
	"github.com/gogf/gf/v2/frame/g"
)

// AlertLogGetPageLstReq 分页获取告警日志列表请求
type AlertLogGetPageLstReq struct {
	g.Meta `method:"get" path:"/alert-log/page-list" summary:"分页获取告警日志列表" tags:"告警日志"`
	*api.PageLstReq
	SceneId      int64    `json:"sceneId" description:"告警场景id"`
	Level        uint     `json:"level" description:"等级"`
	BindTo       int      `json:"bindTo" description:"绑定范围（0设备 1分组）"`
	BindId       string   `json:"bindId" description:"绑定范围id"`
	DeptId       int64    `json:"deptId" description:"部门id"`
	HandleStatus int      `json:"handleStatus" description:"处理状态 0未处理 1处理中 2处理完成"`
	TimeRange    []string `json:"timeRange" description:"时间范围[开始,结束]"`
}

// AlertLogGetPageLstRes 分页获取告警日志列表响应
type AlertLogGetPageLstRes struct {
	*api.PageLstRes[*mymodel.AlertLogResponse] // 使用告警日志响应结构体
}

// AlertLogAddReq 新增告警日志请求
type AlertLogAddReq struct {
	g.Meta `method:"post" path:"/alert-log" summary:"新增告警日志" tags:"告警日志"`
	*mymodel.AlertLog
}

// AlertLogAddRes 新增告警日志响应
type AlertLogAddRes struct{}

// AlertLogUptReq 更新告警日志请求
type AlertLogUptReq struct {
	g.Meta `method:"put" path:"/alert-log/{id}" summary:"更新告警日志" tags:"告警日志"`
	Id     int64 `v:"min:1#告警日志ID必须" path:"id"`
	*mymodel.AlertLog
}

// AlertLogUptRes 更新告警日志响应
type AlertLogUptRes struct{}

// AlertLogUptStatusReq 更新告警日志状态请求
type AlertLogUptStatusReq struct {
	g.Meta       `method:"patch" path:"/alert-log/{id}/status" summary:"更新告警日志状态" tags:"告警日志"`
	Id           int64 `v:"min:1#告警日志ID必须" path:"id"`
	HandleStatus int   `v:"required#处理状态必须" json:"handleStatus"`
}

// AlertLogUptStatusRes 更新告警日志状态响应
type AlertLogUptStatusRes struct{}

// AlertLogDelReq 删除告警日志请求
type AlertLogDelReq struct {
	g.Meta `method:"delete" path:"/alert-log/{id}" summary:"删除告警日志" tags:"告警日志"`
	Id     int64 `v:"min:1#告警日志ID必须" path:"id"`
}

// AlertLogDelRes 删除告警日志响应
type AlertLogDelRes struct{}

// AlertLogGetOneReq 获取单条告警日志请求
type AlertLogGetOneReq struct {
	g.Meta `method:"get" path:"/alert-log/getOne" summary:"获取单条告警日志" tags:"告警日志"`
	Id     int64 `v:"min:1#告警日志ID必须" json:"id"`
}

// AlertLogGetOneRes 获取单条告警日志响应
type AlertLogGetOneRes struct {
	Info *mymodel.AlertLogResponse `json:"info"`
}

// AlertLogGetOptionsReq 获取告警日志选项请求
type AlertLogGetOptionsReq struct {
	g.Meta     `method:"get" path:"/alert-log/getOptions" summary:"获取告警日志选项" tags:"告警日志"`
	FieldKey   string `json:"fieldKey"`   //明确指出key的字段
	FieldLabel string `json:"fieldLabel"` //明确指出label的字段
}

// AlertLogGetOptionsRes 获取告警日志选项响应
type AlertLogGetOptionsRes struct {
	Options []*api.FormOptionsItem `json:"options"`
}

// AlertLogHandleReq 处理告警日志请求
type AlertLogHandleReq struct {
	g.Meta       `method:"post" path:"/alert-log/handle" summary:"处理告警日志" tags:"告警日志"`
	Id           int64  `v:"min:1#告警日志ID必须" json:"id"`
	HandleStatus int    `v:"required#处理状态必须" json:"handleStatus"`
	HandRemark   string `json:"handRemark" description:"处理备注"`
}

// AlertLogHandleRes 处理告警日志响应
type AlertLogHandleRes struct{}

// AlertLogBatchDelReq 批量删除告警日志请求
type AlertLogBatchDelReq struct {
	g.Meta `method:"delete" path:"/alert-log/batch-del" summary:"批量删除告警日志" tags:"告警日志"`
	Ids    []int64 `v:"required#ID列表不能为空" json:"ids"`
}

// AlertLogBatchDelRes 批量删除告警日志响应
type AlertLogBatchDelRes struct{}

// AlertLogBatchHandleReq 批量处理告警日志请求
type AlertLogBatchHandleReq struct {
	g.Meta       `method:"post" path:"/alert-log/batch-handle" summary:"批量处理告警日志" tags:"告警日志"`
	Ids          []int64 `v:"required#ID列表不能为空" json:"ids"`
	HandleStatus int     `v:"required#处理状态必须" json:"handleStatus"`
	HandRemark   string  `json:"handRemark" description:"处理备注"`
}

// AlertLogBatchHandleRes 批量处理告警日志响应
type AlertLogBatchHandleRes struct{}
